<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>Fyne 使用goreleaser打包时的注意事项 | Kessel</title>
    <meta property="og:title" content="Fyne 使用goreleaser打包时的注意事项 - Kessel">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2023-12-20T10:00:00&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2023-12-20T10:00:00&#43;08:00'>
        
    <meta name="Keywords" content="个人笔记">
    <meta name="description" content="Fyne 使用goreleaser打包时的注意事项">
        
    <meta name="author" content="Kessel">
    <meta property="og:url" content="http://kessel7.gitee.io/note/post/Golang/Fyne/Fyne%E4%BD%BF%E7%94%A8goreleaser%E6%89%93%E5%8C%85%E6%97%B6%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/">
    <link rel="shortcut icon" href='/note/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/note/css/normalize.css'>
    <link rel="stylesheet" href='/note/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>

<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="http://kessel7.gitee.io/note/">
                        Kessel
                    </a>
                
                <p class="description">个人笔记</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="http://kessel7.gitee.io/note/">首页</a>
                    
                    <a  href="http://kessel7.gitee.io/note/tools/" title="工具">工具</a>
                    
                    <a  href="http://kessel7.gitee.io/note/archives/" title="归档">归档</a>
                    
                    <a  href="http://kessel7.gitee.io/note/about/" title="关于">关于</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    
    <article class="post">
        <header>
            <h1 class="post-title">Fyne 使用goreleaser打包时的注意事项</h1>
        </header>
        
  <time datetime="2023-12-20T02:00:00Z" class="post-meta meta-date dt-published">
    2023年12月20日
  </time>


<div class="post-meta meta-category">
  <span>&nbsp;|</span>
  
    <a href='/note/categories/Golang' target="_blank">Golang</a>
  
</div>


        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">&nbsp;|
                <span id="busuanzi_value_page_pv"></span> <span>阅读</span>
            </span>
        </div>
        
        
        <div class="post-content">
            <h2 id="goreleaser配置文件如下">goreleaser配置文件如下</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">before</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">hooks</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># You may remove this if you don&#39;t use go modules.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># - go mod tidy</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># you may remove this if you don&#39;t need go generate</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># - go generate ./...</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">builds</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">env</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#ae81ff">CGO_ENABLED=1</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">goos</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#ae81ff">windows</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">goarch</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#ae81ff">amd64</span>
</span></span><span style="display:flex;"><span>      - <span style="color:#ae81ff">386</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">ldflags</span>:
</span></span><span style="display:flex;"><span>      -<span style="color:#ae81ff">H=windowsgui</span>
</span></span><span style="display:flex;"><span>      -<span style="color:#ae81ff">linkmode=internal</span>
</span></span><span style="display:flex;"><span>      -<span style="color:#ae81ff">w</span>
</span></span><span style="display:flex;"><span>      -<span style="color:#ae81ff">s</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># release:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#   github: false</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#   gitlab: false</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#   bitbucket: false</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># archives:</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e"># - format: tar.gz</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#   # this name template makes the OS and Arch compatible with the results of uname.</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#   name_template: &gt;-</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{ .ProjectName }}_</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{- title .Os }}_</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{- if eq .Arch &#34;amd64&#34; }}x86_64</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{- else if eq .Arch &#34;386&#34; }}i386</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{- else }}{{ .Arch }}{{ end }}</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">#     {{- if .Arm }}v{{ .Arm }}{{ end }}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># use zip for windows archives</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># format_overrides:</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># - goos: windows</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">#   format: zip</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">checksum</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name_template</span>: <span style="color:#e6db74">&#39;checksums.txt&#39;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">snapshot</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name_template</span>: <span style="color:#e6db74">&#34;{{ incpatch .Version }}-next&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">changelog</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">sort</span>: <span style="color:#ae81ff">asc</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">filters</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">exclude</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#e6db74">&#39;^docs:&#39;</span>
</span></span><span style="display:flex;"><span>      - <span style="color:#e6db74">&#39;^test:&#39;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># The lines beneath this are called `modelines`. See `:help modeline`</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Feel free to remove those if you don&#39;t want/use them.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># yaml-language-server: $schema=https://goreleaser.com/static/schema.json</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># vim: set ts=2 sw=2 tw=0 fo=cnqoj</span>
</span></span></code></pre></div><h2 id="说明">说明</h2>
<ul>
<li>CGO_ENABLED=1 需开启CGO</li>
<li>linkmode=internal 指定链接模式为internal</li>
<li>-w 表示去掉编译时产生的警告信息</li>
<li>-s 表示去掉符号表信息</li>
</ul>

        </div>

        


        

<div class="post-archive">
    <h2>相关文章</h2>
    <ul class="listing">
        
        <li><a href="/note/post/Golang/Fyne/Fyne%E8%A7%A3%E5%86%B3%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98/">Fyne 解决中文乱码问题</a></li>
        
        <li><a href="/note/post/Golang/Golang%E4%BD%BF%E7%94%A8goreleaser%E6%89%B9%E9%87%8F%E7%BC%96%E8%AF%91%E4%B8%8D%E5%90%8C%E6%9E%B6%E6%9E%84%E7%A8%8B%E5%BA%8F/">Golang 使用goreleaser批量编译不同架构程序</a></li>
        
        <li><a href="/note/post/Golang/Golang%E7%BB%99%E7%BC%96%E8%AF%91%E7%9A%84%E7%A8%8B%E5%BA%8F%E6%B7%BB%E5%8A%A0%E6%9D%A1%E7%A0%81%E5%8F%8A%E7%A8%8B%E5%BA%8F%E8%AF%B4%E6%98%8E/">Golang 给编译的程序添加条码及程序说明</a></li>
        
        <li><a href="/note/post/Golang/GORM/GORM%E5%88%A0%E9%99%A4%E8%A1%A8%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE/">Golang GORM 删除表所有数据</a></li>
        
        <li><a href="/note/post/Golang/GORM/GORM%E6%9F%A5%E8%AF%A2%E8%A1%A8%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE/">Golang GORM 查询表所有数据</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/note/tags/golang' target="_blank">golang</a></li>
                
                <li><a href='/note/tags/Fyne' target="_blank">Fyne</a></li>
                
            </ul>
            
        </div>
    </article>
    
    

    
    
    
    

</div>

                    <footer id="footer">
    <div>
        &copy; 2024 <a href="http://kessel7.gitee.io/note/">Kessel By Kessel</a>
        
    </div>
    <br />
    
</footer>


    
    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/note/js/totop.js?v=0.0.0' async=""></script>
<style type="text/css">
div.highlight {
    position: relative;
    margin: 1em 0px;
}

.copy-code {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(78, 78, 78, 0.8);
    border-radius: var(--radius);
    padding: 0 5px;
    font: inherit;
    user-select: none;
    cursor: pointer;
    border: 0;
    --radius: 8px;
}

div.highlight:hover .copy-code,pre:hover .copy-code {
    display: block;
}

</style>
<script>
    document.querySelectorAll('pre > code').forEach((codeblock) => {
        const container = codeblock.parentNode.parentNode;

        const copybutton = document.createElement('button');
        copybutton.classList.add('copy-code');
        copybutton.innerHTML = 'copy';

        function copyingDone() {
            copybutton.innerHTML = 'copied!';
            setTimeout(() => {
                copybutton.innerHTML = 'copy';
            }, 2000);
        }

        copybutton.addEventListener('click', (cb) => {
            if ('clipboard' in navigator) {
                navigator.clipboard.writeText(codeblock.textContent);
                copyingDone();
                return;
            }

            const range = document.createRange();
            range.selectNodeContents(codeblock);
            const selection = window.getSelection();
            selection.removeAllRanges();
            selection.addRange(range);
            try {
                document.execCommand('copy');
                copyingDone();
            } catch (e) { };
            selection.removeRange(range);
        });

        if (container.classList.contains("highlight")) {
            container.appendChild(copybutton);
        } else if (container.parentNode.firstChild == container) {
            
        } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
            
            codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
        } else {
            
            codeblock.parentNode.appendChild(copybutton);
        }
    });
</script>


    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='http://kessel7.gitee.io/note/search' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="http://kessel7.gitee.io/note/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>

    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Linux/Linux%E5%BC%80%E5%90%AFSSH%E7%99%BB%E5%BD%95/" title="Linux 开启SSH登录" target="_blank">Linux 开启SSH登录</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/Fyne/Fyne%E8%A7%A3%E5%86%B3%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98/" title="Fyne 解决中文乱码问题" target="_blank">Fyne 解决中文乱码问题</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/Fyne/Fyne%E4%BD%BF%E7%94%A8goreleaser%E6%89%93%E5%8C%85%E6%97%B6%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/" title="Fyne 使用goreleaser打包时的注意事项" target="_blank">Fyne 使用goreleaser打包时的注意事项</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/Golang%E7%BB%99%E7%BC%96%E8%AF%91%E7%9A%84%E7%A8%8B%E5%BA%8F%E6%B7%BB%E5%8A%A0%E6%9D%A1%E7%A0%81%E5%8F%8A%E7%A8%8B%E5%BA%8F%E8%AF%B4%E6%98%8E/" title="Golang 给编译的程序添加条码及程序说明" target="_blank">Golang 给编译的程序添加条码及程序说明</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/Golang%E4%BD%BF%E7%94%A8goreleaser%E6%89%B9%E9%87%8F%E7%BC%96%E8%AF%91%E4%B8%8D%E5%90%8C%E6%9E%B6%E6%9E%84%E7%A8%8B%E5%BA%8F/" title="Golang 使用goreleaser批量编译不同架构程序" target="_blank">Golang 使用goreleaser批量编译不同架构程序</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/%E6%95%B0%E6%8D%AE%E5%BA%93/Oracle/Oracle%E6%81%A2%E5%A4%8Ddelete%E8%AF%AF%E5%88%A0%E6%95%B0%E6%8D%AE/" title="Oracle 恢复delete误删数据" target="_blank">Oracle 恢复delete误删数据</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Python/Python%E8%A7%A3%E5%86%B3Cython%E7%BC%96%E8%AF%91%E6%97%B6%E6%8A%A5%E7%BC%96%E8%AF%91%E5%99%A8%E9%94%99%E8%AF%AF/" title="Python 解决Cython编译时报编译器错误" target="_blank">Python 解决Cython编译时报编译器错误</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/windows/Windows%E5%90%8C%E6%97%B6%E4%BD%BF%E7%94%A8%E5%86%85%E5%A4%96%E7%BD%91%E8%B7%AF%E7%94%B1/" title="Windows 同时使用内外网(路由)" target="_blank">Windows 同时使用内外网(路由)</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/GORM/GORM%E6%9F%A5%E8%AF%A2%E8%A1%A8%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE/" title="Golang GORM 查询表所有数据" target="_blank">Golang GORM 查询表所有数据</a>
    </li>
    
    <li>
        <a href="http://kessel7.gitee.io/note/post/Golang/GORM/GORM%E5%88%A0%E9%99%A4%E8%A1%A8%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE/" title="Golang GORM 删除表所有数据" target="_blank">Golang GORM 删除表所有数据</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title"><a href='/note/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="http://kessel7.gitee.io/note/categories/Golang/">Golang (8)</a></li>
    
    <li><a href="http://kessel7.gitee.io/note/categories/Python/">Python (1)</a></li>
    
    <li><a href="http://kessel7.gitee.io/note/categories/Windows/">Windows (1)</a></li>
    
    <li><a href="http://kessel7.gitee.io/note/categories/linux/">linux (1)</a></li>
    
    <li><a href="http://kessel7.gitee.io/note/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/note/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="http://kessel7.gitee.io/note/tags/Fyne/">Fyne</a>
    
    <a href="http://kessel7.gitee.io/note/tags/Gorm/">Gorm</a>
    
    <a href="http://kessel7.gitee.io/note/tags/golang/">golang</a>
    
    <a href="http://kessel7.gitee.io/note/tags/linux/">linux</a>
    
    <a href="http://kessel7.gitee.io/note/tags/oracle/">oracle</a>
    
    <a href="http://kessel7.gitee.io/note/tags/python/">python</a>
    
    <a href="http://kessel7.gitee.io/note/tags/windows/">windows</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="https://cn.bing.com/?scope=web" title="超链接">超链接</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="http://kessel7.gitee.io/note/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>